<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>VUE Template</title>
    <script type="text/javascript" src="../js/vue.js"></script>
</head>
<body>
    <div id="root">
        <school></school>
        <hello></hello>
    </div>
</body>
    <script type="text/javascript">
        Vue.config.devtools = true

        const hello = Vue.extend({
            template:`
            <div>
                <h1>{{msg}}</h1>
            </div>
            `,
            data(){
                return{
                    msg:"hello"
                }
            }
        })


        //创建school组件
        const school = Vue.extend({
            template:`
            <div>
                <h2>学校名称：{{schoolName}}</h2>
                <h2>学校地址：{{address}}</h2>            
            </div>
            `
            ,
            data(){
                return {
                    schoolName:'xxx',
                    address:'南京'
                }
            }
        })
        console.log('@',school)
        console.log('#',hello)
        console.log(school===hello)
        const vm = new Vue({
            el:'#root',
            //注册组件
            components:{
                school,hello
            }
        })

    </script>
</html>